package com.hjc.entity;

import java.util.ArrayList;
import java.util.List;

public class Department {

    private String departmentName;

    private List<User> userList;

    public Department() {
        this.userList = new ArrayList<>();
        System.out.println("创建 Department 对象");
    }

    public void addUser(User user) {
        this.userList.add(user);
    }

    @Override
    public String toString() {
        return "Department{" +
                "departmentName='" + departmentName + '\'' +
                ", userList=" + userList +
                '}';
    }

    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }

    public List<User> getUserList() {
        return userList;
    }

    public void setUserList(List<User> userList) {
        this.userList = userList;
    }
}